// 云函数入口文件
const cloud = require('wx-server-sdk')
const uploadQRcode = require("./uploadQRcode/index")
const deleteQRcode = require("./deleteQRcode/index")
const getQRcode = require("./getQRcode/index")
const checkQRcode = require("./checkQRcode/index")

// 云函数入口函数
exports.main = async (event, context) => {
  switch(event.type){
    case "getQRcode":
      return await getQRcode.main(event,context)
    case "checkQRcode":
        return await checkQRcode.main(event,context)
    case "uploadQRcode":
      return await uploadQRcode.main(event,context)
    case "deleteQRcode":
      return await deleteQRcode.main(event,context)
  }
  return {
    code:400,
    data:{},
    msg:"wrong type"
  }
}